<?php

define('KC_INDEX',True);

require_once '../global.php';

/**
	
	POST过来的参数有 ass、kname、tags、sign
	MD5(ass=[ass]&kname=[kname]&tags=[tags]{info['sign']}) == sign 当一致的时候，验证通过
*/
function king_def(){
	global $king;
	
	$king->access('portal_express');



	$url="/api/list_kc.php?pid=PID&rn=RN";
	$title='最新列表';


	
	$coun=$king->db->getRows_number('%s__article',"k_shenhe = 1");


	$pid=isset($_GET['pid']) ? kc_get('pid',2,1) :1;
	$rn=isset($_GET['rn']) ? kc_get('rn',2,1) :20;
	if($rn>100) $rn=100;	
	$number=$rn;
	$skip= ($pid=='1')?0:(((int)$pid)-1) * $number;	
	$limit='limit '.$skip.','.$number;
	
	
	$s='';	
	if($data=$king->db->getRows("select kid,ktitle,listid,ndate,k_1,nlastdate from %s__article where  k_shenhe = 1 order by nlastdate desc ".$limit."")){		
	}else{
		$s='<p class="k_err">暂时没有文章!</p>';
	}
	


	
	$pagelist= $king->db->pagelist($url,$coun,$pid,$rn,$_inner=null);


	$tmp=new KC_Template_class('template/default.htm',$king->config('templatepath').'/inside/user/new.htm');
	$tmp->assign('main',$data);
	$tmp->assign('pagelist',$pagelist);
	$tmp->assign('userid',$king->user->userid);
	$tmp->assign('nav',$title);
	$tmp->assign('title',$title);
	$tmp->assign('js',$bs);
	$tmp->assign('coun',$coun);
	echo $tmp->output();




}



?>